import { VxeGridPropTypes } from "vxe-table";

export const columns: VxeGridPropTypes.Columns = [
    {type: 'checkbox', width: 40, fixed: 'left',},
    {type: 'seq', title: '序号', treeNode: false, visible: false, width: 55,},
    // {field: 'id', title: 'ID', width: 60, visible: false,},
    {field: 'code', title: '商品编码', sortable: false, visible: true, width: 120, },
    {field: 'name', title: '商品名称', sortable: false, width: 180,},
    {field: 'cate.name', title: '类别', sortable: false, width: 90,},
    {field: 'specs', title: '规格型号', sortable: false, width: 120, cellRender: {name: 'GoodsSpecs',},},
    {field: 'images', title: '图片', sortable: false, width: 150, cellRender: {name: 'GoodsImage',},},
    {field: 'unit.name', title: '计量单位', sortable: false, width: 70,},
    {field: 'enable', title: '启用', sortable: false, width: 50, formatter: ({row,}) => (row.enable === 0 ? '禁用' : '启用'),},
    {field: 'isGift', title: '赠品', sortable: false, width: 60, formatter: ({row,}) => (row.isGift === 0 ? '不是' : '是赠品'),},
    {field: 'brand', title: '品牌', visible: false,sortable: false, width: 90,},
    {field: 'pricePur', title: '采购价', visible: false, sortable: false, width: 70,},
    {field: 'priceBatch', title: '批发价', visible: true, sortable: false, width: 70,},
    {field: 'priceRetail', title: '零售价', visible: true, sortable: false, width: 70,},
    {field: 'priceMin', title: '最低售价', visible: false, sortable: false, width: 70,},
    {field: 'disRate1', title: '折扣率1', visible: false, sortable: false, width: 70,},
    //
    {field: 'validDay', title: '保质期天数', visible: true, sortable: false, width: 90,},
    {field: 'warningDays', title: '预警天数', visible: true, sortable: false, width: 80,},
    {field: 'batchNum', title: '批次号', visible: false, sortable: false, width: 180,},
    {field: 'area', title: '产地', visible: false, sortable: false, width: 180,},
    {field: 'memo', title: '备注', visible: false, sortable: false, width: 180,},
  
    {field: 'createdTime', title: '创建时间', visible: false, sortable: false, width: 140,},
    {field: 'updatedTime', title: '更新时间', visible: false, sortable: false,},
  ];

export const pagerConfig: VxeGridPropTypes.PagerConfig = {
    total: 0,
    currentPage: 1,
    pageSize: 20,
    pageSizes: [20, 50, 100, 200, 500, 1000],
    layouts: ['PrevJump', 'PrevPage', 'Number', 'NextPage', 'NextJump', 'Sizes', 'FullJump', 'Total'],
    pagerCount: 3,
    border: true,
    background: true,
    perfect: true,
};


